package com.adgox.tiantianbiting.main;

import android.app.Activity;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.adgox.tiantianbiting.R;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import butterknife.BindView;
import butterknife.ButterKnife;

public class StartActivity extends Activity {

    private int count = 2;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        ButterKnife.bind(this);
        handler.postDelayed(runnable,1000);
    }

    Handler handler = new Handler();
    Runnable runnable = new Runnable() {
        @Override
        public void run() {
            count--;
            if (count <= 0){
                startActivity(new Intent(StartActivity.this,MainActivity.class));
                finish();
            } else {
                handler.postDelayed(runnable,1000);
            }
        }
    };
}
